
package com.fis.hlo.pm.persistence;

import java.math.BigDecimal;
import java.util.Date;

import com.fis.mca.util.StringUtil;

public class Accounts {

    protected long accId;
    protected AccountType accType;
    protected BigDecimal balance;
    protected CycleType cycleType;
    protected String description;
    protected Long groupId;
    protected String code;
    protected String name;
    protected Objects objects;
    protected String status;
    protected Long typeId;
    private Date createDate;

    public Accounts(){
    	
    }

	public Accounts(long accId, AccountType accType, BigDecimal balance,
			CycleType cycleType, String description, Long groupId, String code,
			String name, Objects objects, String status, Long typeId,
			Date createDate) {
		super();
		this.accId = accId;
		this.accType = accType;
		this.balance = balance;
		this.cycleType = cycleType;
		this.description = description;
		this.groupId = groupId;
		this.code = code;
		this.name = name;
		this.objects = objects;
		this.status = status;
		this.typeId = typeId;
		this.createDate = createDate;
	}

	public long getAccId() {
		return accId;
	}

	public void setAccId(long accId) {
		this.accId = accId;
	}

	public AccountType getAccType() {
		return accType;
	}

	public void setAccType(AccountType accType) {
		this.accType = accType;
	}

	public BigDecimal getBalance() {
		return balance;
	}

	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}

	public CycleType getCycleType() {
		return cycleType;
	}

	public void setCycleType(CycleType cycleType) {
		this.cycleType = cycleType;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Long getGroupId() {
		return groupId;
	}

	public void setGroupId(Long groupId) {
		this.groupId = groupId;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = (code == null) ? code : code.trim().toUpperCase();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Objects getObjects() {
		return objects;
	}

	public void setObjects(Objects objects) {
		this.objects = objects;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Long getTypeId() {
		return typeId;
	}

	public void setTypeId(Long typeId) {
		this.typeId = typeId;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
    
	  @Override
		public String toString() {
			// TODO Auto-generated method stub
			return this.name;
		}

		public boolean equals(Object obj)
		{
			if (this == obj)
			{
				return true;
			}
			if ((obj == null) || (obj.getClass() != this.getClass()))
			{
				return false;
			}
			// object must be Test at this point
			Accounts cycle = (Accounts) obj;
			return accId == cycle.accId;
		}


		
		public int compareTo(Accounts o)
		{
			String o1 = this.getName();
			String o2 = o.getName();
			return StringUtil.compareVietnameseString(o1, o2);
		}
    

}
